digits="27"
def merge(a,b):
    merge_list=[]
    for i in range(len(a)):
        for j in range(len(b)):
            merge_list.append([a[i]+b[j]])
    return merge_list
def letterCombinations(digits):
    dictionary={'2':['a','b','c'],'3':['d','e','f'],'4':['g','h','i'],'5':['j','k','l'],'6':['m','n','o'],'7':['p','q','r','s'],'8':['t','u','v'],'9':['w','x','y','z']}
    if len(digits)==0:
        return []
    merge_list=dictionary[digits[0]]
    for i in range(1,len(digits)):
        merge_list=merge(merge_list,dictionary[digits[i]])
    return merge_list
print(letterCombinations(digits))